<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <a href="/" class="navbar-brand"><b>呆蜗牛Demo</b></a>
            <%--<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">--%>
            <%--<i class="fa fa-bars"></i>--%>
            <%--</button>--%>
        </div>
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <!-- User Account Menu -->
                <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <c:if test="${userContext.user != null}">
                            <!-- The user image in the navbar-->
                            <img src="/assets/img/userImg/userRight.jpg" class="user-image" alt="User Image">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs">${userContext.user.name}</span>
                        </c:if>
                        <c:if test="${userContext.user == null}">
                            <!-- The user image in the navbar-->
                            <img src="/assets/img/userImg/userLeft.gif" class="user-image" alt="User Image">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs">登录/注册</span>
                        </c:if>
                    </a>
                    <ul class="dropdown-menu">
                        <c:if test="${userContext.user != null}">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img src="/assets/img/userImg/userRight.jpg" class="img-circle" alt="User Image">
                                <p>
                                    ${userContext.user.name} - ${userContext.user.loginName}
                                    <small>${userContext.user.createDate}</small>
                                </p>
                            </li>
                        </c:if>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <c:if test="${userContext.user != null}">
                                <div class="pull-left">
                                    <a href="#" class="btn btn-default btn-flat">个人信息</a>
                                </div>
                                <div class="pull-right">
                                    <a href="/logout" class="btn btn-default btn-flat">退出</a>
                                </div>
                            </c:if>
                            <c:if test="${userContext.user == null}">
                                <div class="pull-left">
                                    <a href="/register" class="btn btn-default btn-flat">注册</a>
                                </div>
                                <div class="pull-right">
                                    <a href="/login" class="btn btn-default btn-flat">登录</a>
                                </div>
                            </c:if>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>